package com.rocksea.app.entry;

import com.mor.dataacquisition.DataAcquisition;
import com.rocksea.app.utils.PerUtils;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * Created by Mrw on 2017/8/19.
 * 静载数据json解析对象
 *
 */

public class JYData
{

    public int remoteId;
    public String BaseInfoId;
    public String VendorID;
    public byte TestType;
    public String StandardString;
    public String MachineID;
	public String SerialNo;
	public String PileNo;
	public String FileName;
    public float PileDiameter;
    public float PileLength;
    public int PreSeries;
    public float MaxLoad;
    public float BoardArea;
    public String StartTime;
    public byte[] LoadInterva;
    public byte[] UnloadInterval;
    public String SensorID;
	public int[] SensorUsed;
    public byte PressType;
	public String PressID;
	public float FSensorAdjust;
	public float FSensorMax;
	public String CustomParam;

    public double GpsLongitude;
    public double GpsLatitude;
    public byte GpsIsValid;
    public String sourceData;

    public List<Data> Data;
    public List<Log> Log;
    public byte MachineType;

    public long inspectionFormId;
    public long pileId;
    public String inspectionFormNum;

    public static class Data
    {
        public int remoteId;
        public String BaseInfoId;
        public String uuid;
        public String SampleTime;
        public byte DataType;
        public int LoadDirect;
        public int Grade;
        public int SampleCount;
        public int TimeCount;
        public float Loading;
        public float RealLoading;
        public float RealPress;
        public float[] SensorValue;
        public float Saverage;
    }

    public static class Log
    {
        public int remoteId;
        public String BaseInfoId;
        public String uuid;
        public String EventTime;
        public String EventInfo;
        public String Remark;
    }

    public static String makeLogJson(String baseInfoId)
    {
        JSONObject log = new JSONObject();
        try {
            log.put("BaseInfoId",baseInfoId);
            log.put("uuid", DataAcquisition.getInstance().getUuid());
            log.put("EventTime", PerUtils.dateToStr(new Date()));
            log.put("EventInfo","结束实验");
            log.put("Remark","{}");
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return log.toString();


    }


}





